package com.dyy.proxy.jdk.dynamic;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author dingyy@jccfc.com
 * @since 2021/12/12 22:00
 */
public class AdminServiceJdkInvocation implements InvocationHandler {

    private final Object target;

    public AdminServiceJdkInvocation(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("判断客户是否有权限操作数据变更");
        Object invoke = method.invoke(target);
        System.out.println("记录客户的LOG日志 ");
        return invoke;
    }
}
